package com.mtzqc.common.manager

import com.mtzqc.common.kt.loadService
import com.mtzqc.common.service.CrashService

object CrashManager {
    val service: CrashService by lazy {
        loadService()
    }

    fun postCrash(message: CharSequence?) {
        if (!message.isNullOrBlank()) {
            service.crashLog(message)
        }
    }

    fun postCrash(e: Throwable?) {
        e?.let {
            service.crashLog(it)
        }
    }
}